var status = 0;
var townArray = [
    100000000,
    101000000,
    102000000,
    103000000,
    105040300,
    120000000,
    211000000,
    230000000,
    220000000,
    221000000,
    222000000,
    240000000,
    250000000,
    260000200,
    261000000,
    104000000,
    200000000,
];

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (status == 0 && mode == 0)
            cm.dispose();
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendNext("111?");
        } else if (status == 1) {
            var text = "2222?#b\r\n";
            for(var i = 0; i < townArray.length; i++) {
                text += "\r\n#L" + i + "#" + cm.getPlayer().getMapName(townArray[i]) + "#l";
            }
            cm.sendSimple(text);
        } else if (status == 2) {
            var text = "333\r\n\r\n";
            cm.sendOk(text + cm.getAllDonator(townArray[selection]) + "\r\n444.");
            cm.dispose();
        }
    }
}